home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / PRGMANIA / XA_6S / SOURCE / BOX3D.C < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-23  |  2.2 KB  |  102 lines

  1. /*
  2.  * XaAES - XaAES Ain't the AES
  3.  *
  4.  * A multitasking AES replacement for MiNT
  5.  *
  6.  */
  7.  
  8. #include <VDI.H>
  9. #include "XA_TYPES.H"
  10. #include "XA_GLOBL.H"
  11.  
  12. void XA_3D_rect(short x, short y, short w, short h, short b, short b1)
  13. {
  14.     short pnt[10];
  15.     
  16.     vsf_color(V_handle,display.dial_colours.bg_col);
  17.     vsf_interior(V_handle,FIS_SOLID);        /* Select solid fills - maybe make this an option? */
  18.     pnt[0]=x; pnt[1]=y; pnt[2]=x+w; pnt[3]=y+h;
  19.     v_bar(V_handle,pnt);
  20.  
  21.     vsl_color(V_handle,display.dial_colours.b_r_col);
  22.  
  23.     pnt[0]=x+b; pnt[1]=y+h-b;
  24.     pnt[2]=x+b; pnt[3]=y+b;
  25.     pnt[4]=x+w-b; pnt[5]=y+b;
  26.     v_pline(V_handle,3,pnt);
  27.     
  28.     pnt[0]=x+b+4; pnt[1]=y+h-b-1;
  29.     pnt[2]=x+w-b-1; pnt[3]=y+h-b-1;
  30.     pnt[4]=x+w-b-1; pnt[5]=y+b+1;
  31.     v_pline(V_handle,3,pnt);
  32.     
  33.     vsl_color(V_handle,display.dial_colours.t_l_col);
  34.  
  35.     pnt[0]=x+w-b; pnt[1]=y+b+1;
  36.     pnt[2]=x+w-b; pnt[3]=y+h-b;
  37.     pnt[4]=x+b+1; pnt[5]=y+h-b;
  38.     v_pline(V_handle,3,pnt);
  39.     
  40.     pnt[0]=x+b+1; pnt[1]=y+h-b-1;
  41.     pnt[2]=x+b+1; pnt[3]=y+b+1;
  42.     pnt[4]=x+w-b-1; pnt[5]=y+b+1;
  43.     v_pline(V_handle,3,pnt);
  44.     
  45.     if (!b1) return;
  46.     
  47.     vsl_color(V_handle,display.dial_colours.border_col);
  48.     pnt[0]=x; pnt[1]=y;
  49.     pnt[2]=x+w; pnt[3]=y;
  50.     pnt[4]=x+w; pnt[5]=y+h;
  51.     pnt[6]=x; pnt[7]=y+h;
  52.     pnt[8]=x; pnt[9]=y;
  53.     v_pline(V_handle,5,pnt);
  54. }
  55.  
  56. void XA_3D_pushbutton(short x, short y, short w, short h, short selected)
  57. {
  58.     short pnt[6];
  59.  
  60.     pnt[0]=x; pnt[1]=y;
  61.     pnt[2]=x+w; pnt[3]=y+h;
  62.     v_bar(V_handle, pnt);
  63.  
  64. #if 1
  65.     if (selected)
  66.         vsl_color(V_handle,display.dial_colours.b_r_col);
  67.     else
  68.         vsl_color(V_handle,display.dial_colours.t_l_col);
  69. #else
  70.     vsl_color(V_handle,display.dial_colours.b_r_col);
  71.     vsl_udsty(V_handle,0xAAAA);
  72.     if (selected)
  73.         vsl_type(V_handle,SOLID);
  74.     else
  75.         vsl_type(V_handle,USERLINE);
  76. #endif
  77.  
  78.     pnt[0]=x; pnt[1]=y+h;
  79.     pnt[2]=x; pnt[3]=y;
  80.     pnt[4]=x+w; pnt[5]=y;
  81.     v_pline(V_handle,3,pnt);
  82.  
  83. #if 1
  84.     if (selected)
  85.         vsl_color(V_handle,display.dial_colours.t_l_col);
  86.     else
  87.         vsl_color(V_handle,display.dial_colours.b_r_col);
  88. #else
  89.     if (selected)
  90.         vsl_type(V_handle,USERLINE);
  91.     else
  92.         vsl_type(V_handle,SOLID);
  93. #endif
  94.  
  95.     pnt[0]=x+1; pnt[1]=y+h;
  96.     pnt[2]=x+w; pnt[3]=y+h;
  97.     pnt[4]=x+w; pnt[5]=y+1;
  98.     v_pline(V_handle,3,pnt);
  99.  
  100.     vsl_type(V_handle,SOLID);
  101. }
  102.